/*
 * @Author: xuetao 3168581151@qq.com
 * @Date: 2025-02-20
 * @LastEditors: xuetao 3168581151@qq.com
 * @LastEditTime: 2025-02-20
 * @Description: 联系人状态
 */
enum ContactStatus {
  friend(1, '好友'),
  delete(2, '已删除'),
  black(3, '已拉黑');

  const ContactStatus(this.value, this.label);

  final int value; // 对应数据库/接口的整数值
  final String label; // 显示用文本
  // 静态转换方法
  static ContactStatus fromInt(int value) =>
      values.firstWhere((e) => e.value == value,
          orElse: () => throw ArgumentError('Invalid value'));
}
